package com.wolfpire.workflow.assign;

import java.util.Date;

import javax.annotation.Resource;

import org.jbpm.api.ProcessEngine;
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;

public class TaskQuartzJob {

	@Resource private ProcessEngine processEngine;
	
	
	protected void execute(){
		//通过processEngine的execute方式可以将一段代码放到一个Hibernate的事务里执行这样就可以避免延迟加载。
		processEngine.execute(new TaskQuartzCommand());
	}

	class TaskQuartzCommand implements Command<Void>{

		private static final long serialVersionUID = 9215664887156372441L;

		public Void execute(Environment environment) throws Exception {
			System.out.println("================start:"+new Date());
			// TODO:
			System.out.println("================end:"+new Date());
			return null;
		}
		
		
		
	}
}
